<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui">
    <p:panelGrid style="width: 100%">
        <f:facet name="header">
            <p:row>
                <p:column colspan="5">#{msg.lensometria}</p:column>
            </p:row>
            <p:row>
                <p:column colspan="2"></p:column>
                <p:column >#{msg.esfera}</p:column>
                <p:column >#{msg.cilindro}</p:column>
                <p:column >#{msg.eje}</p:column>
            </p:row>
        </f:facet>

        <p:row>
            <p:column styleClass="ui-widget-header" rowspan="2">VL</p:column>
            <p:column styleClass="ui-widget-header">OD</p:column>
            <p:column> 
                <p:autoComplete dropdown="true" value="#{administrarControlAction.lensometria.vlOdEsf}"   validator="#{administrarControlAction.validateEsferaCilindroEje}"
                                completeMethod="#{administrarControlAction.autoCompleteEsfera}" maxResults="10" style="width: 100%" /> 

            </p:column>
            <p:column>
                <p:autoComplete validator="#{administrarControlAction.validateEsferaCilindroEje}" dropdown="true" value="#{administrarControlAction.lensometria.vlOdCil}"   
                                completeMethod="#{administrarControlAction.autoCompleteCilindro}" maxResults="10" style="width: 100%" />
            </p:column>
            <p:column>
                <p:autoComplete validator="#{administrarControlAction.validateEsferaCilindroEje}" dropdown="true" value="#{administrarControlAction.lensometria.vlOdEje}"   
                                completeMethod="#{administrarControlAction.autoCompleteEje}" maxResults="10" style="width: 100%" />
            </p:column>
        </p:row>

        <p:row>
            <p:column styleClass="ui-widget-header">OI</p:column>
            <p:column> 
                <p:autoComplete validator="#{administrarControlAction.validateEsferaCilindroEje}" dropdown="true" value="#{administrarControlAction.lensometria.vlOiEsf}"   
                                completeMethod="#{administrarControlAction.autoCompleteEsfera}" maxResults="10" style="width: 100%" />
            </p:column>
            <p:column>
                <p:autoComplete validator="#{administrarControlAction.validateEsferaCilindroEje}" dropdown="true" value="#{administrarControlAction.lensometria.vlOiCil}"   
                                completeMethod="#{administrarControlAction.autoCompleteCilindro}" maxResults="10" style="width: 100%" />
            </p:column>
            <p:column>
                <p:autoComplete validator="#{administrarControlAction.validateEsferaCilindroEje}" dropdown="true" value="#{administrarControlAction.lensometria.vlOiEje}"   
                                completeMethod="#{administrarControlAction.autoCompleteEje}" maxResults="10" style="width: 100%" />
            </p:column>
        </p:row>

        <p:row>
            <p:column styleClass="ui-widget-header" rowspan="2">VP</p:column>
            <p:column styleClass="ui-widget-header">OD</p:column>
            <p:column> 
                <p:autoComplete validator="#{administrarControlAction.validateEsferaCilindroEje}" dropdown="true" value="#{administrarControlAction.lensometria.vpOdEsf}"   
                                completeMethod="#{administrarControlAction.autoCompleteEsfera}" maxResults="10" style="width: 100%" />
            </p:column>
            <p:column>
                <p:autoComplete validator="#{administrarControlAction.validateEsferaCilindroEje}" dropdown="true" value="#{administrarControlAction.lensometria.vpOdCil}"   
                                completeMethod="#{administrarControlAction.autoCompleteCilindro}" maxResults="10" style="width: 100%" />
            </p:column>
            <p:column>
                <p:autoComplete validator="#{administrarControlAction.validateEsferaCilindroEje}" dropdown="true" value="#{administrarControlAction.lensometria.vpOdEje}"   
                                completeMethod="#{administrarControlAction.autoCompleteEje}" maxResults="10" style="width: 100%" />
            </p:column>
        </p:row>

        <p:row>
            <p:column styleClass="ui-widget-header">OI</p:column>
            <p:column> 
                <p:autoComplete validator="#{administrarControlAction.validateEsferaCilindroEje}" dropdown="true" value="#{administrarControlAction.lensometria.vpOiEsf}"   
                                completeMethod="#{administrarControlAction.autoCompleteEsfera}" maxResults="10" style="width: 100%" />
            </p:column>
            <p:column>
                <p:autoComplete validator="#{administrarControlAction.validateEsferaCilindroEje}" dropdown="true" value="#{administrarControlAction.lensometria.vpOiCil}"   
                                completeMethod="#{administrarControlAction.autoCompleteCilindro}" maxResults="10" style="width: 100%" />
            </p:column>
            <p:column>
                <p:autoComplete validator="#{administrarControlAction.validateEsferaCilindroEje}" dropdown="true" value="#{administrarControlAction.lensometria.vpOiEje}"   
                                completeMethod="#{administrarControlAction.autoCompleteEje}" maxResults="10" style="width: 100%" />
            </p:column>
        </p:row>

        <p:row>
            <p:column styleClass="ui-widget-header" rowspan="2">ADD</p:column>
            <p:column styleClass="ui-widget-header">OD</p:column>
            <p:column> 
                <p:autoComplete validator="#{administrarControlAction.validateAdd}" dropdown="true" value="#{administrarControlAction.lensometria.addOd}"   
                                completeMethod="#{administrarControlAction.autoCompleteAdd}" maxResults="10" style="width: 100%" />
            </p:column>

            <p:column colspan="2" rowspan="2">
                #{msg.lente}
                <p:selectOneMenu id="idTipLenteLensometria"
                                 value="#{administrarControlAction.lensometria.tTipLente}"
                                 converter="conversorEntidad" style="width: 100%">
                    <f:selectItem itemLabel="#{msg.seleccione}" itemValue="" />
                    <f:selectItems value="#{administrarControlAction.listaTipoLentes}"
                                   var="tipoLente" itemLabel="#{tipoLente.desTipLente}"
                                   itemValue="#{tipoLente}" />

                </p:selectOneMenu>
            </p:column>
        </p:row>

        <p:row>
            <p:column styleClass="ui-widget-header">OI</p:column>
            <p:column>
                <p:autoComplete validator="#{administrarControlAction.validateAdd}" dropdown="true" value="#{administrarControlAction.lensometria.addOi}"   
                                completeMethod="#{administrarControlAction.autoCompleteAdd}" maxResults="10" style="width: 100%" />
            </p:column>
        </p:row>
        <p:row>
            <p:column colspan="5">
                #{msg.observaciones}:
                <p:inputTextarea value="#{administrarControlAction.lensometria.desOb}" style="width: 100%"/>
            </p:column>
        </p:row>
    </p:panelGrid>

    <p:commandButton id="guardarLensomeria" value="#{msg.guardar}"
                     action="#{administrarControlAction.crearLensometria()}" />

</ui:composition>